package com.ruoyi.product.controller;


import com.ruoyi.common.core.domain.R;

import com.ruoyi.product.domain.dto.WoSubDto;
import com.ruoyi.product.service.WoRawSubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/woRawSub")
public class WoSubController {
    @Autowired
    WoRawSubService woRawSubService;

    @PostMapping("/getWoRawSubByPage")
    public R export(@RequestBody WoSubDto materialDto)
    {
        return R.ok(woRawSubService.getWoRawSubByPage(materialDto));
    }

    @PostMapping("/addWoRawSub")
    public R addTest(@RequestBody WoSubDto materialDto){
        woRawSubService.addWoRawSub(materialDto);
        return R.ok("添加成功");
    }

    @PostMapping("/delWoRawSub")
    public R delTest(@RequestBody WoSubDto materialDto){
        woRawSubService.delWoRawSub(materialDto);
        return R.ok("删除成功");
    }

    @PostMapping("/updateWoRawSub")
    public R updateTest(@RequestBody WoSubDto materialDto){
        woRawSubService.updateWoRawSub(materialDto);
        return R.ok("锁定成功");
    }
}
